#ifndef __SHAPE_H__
#define __SHAPE_H__
#include <GL/glut.h>
#include "point.h"

class Shape
{

  public:
	// 位置
	Point position;
	// 当前运动速度
	GLdouble x_velocity;
	GLdouble y_velocity;
	Shape() = default;
	Shape(Point p, GLdouble v_x, GLdouble v_y) : x_velocity(v_x), y_velocity(v_y), position(p) {}
	Shape(GLdouble _x, GLdouble _y, GLdouble x, GLdouble y) : x_velocity(x), y_velocity(y), position(_x, _y) {}
	// virtual GLint getEdgeLeft() =0 ;
	// virtual GLint getEdgeRight() =0;
	// virtual GLint getEdgeButtom() =0;
	// virtual GLint getEdgeTop() =0;
};
/**
 * 矩形类
 * */
class Rect : public Shape
{
  public:
	// 矩形尺寸
	GLuint width;
	GLuint height;
	Rect() = default;
	Rect(Point p, GLuint w, GLuint h, GLdouble v_x, GLdouble v_y) : Shape(p, v_x, v_y), width(w), height(h) {}
	Rect(GLdouble _x, GLdouble _y, GLuint w, GLuint h, GLdouble v_x, GLdouble v_y) : Shape(_x, _y, v_x, v_y), width(w), height(h) {}
	GLint getEdgeLeft();
	GLint getEdgeRight();
	GLint getEdgeButtom();
	GLint getEdgeTop();
};
/**
 * 球
 * */
class Sphere : public Shape
{
  public:
	// 球的半径
	GLdouble radius;
	Sphere() = default;
	Sphere(Point p, GLdouble r, GLdouble v_x, GLdouble v_y) :
				 Shape(p, v_x, v_y), radius(r) {}
	Sphere(GLdouble _x, GLdouble _y, GLdouble r, GLdouble v_x, GLdouble v_y) :
				 Shape(_x, _y, v_x, v_y), radius(r) {}
	GLint getEdgeLeft();
	GLint getEdgeRight();
	GLint getEdgeButtom();
	GLint getEdgeTop();
};
#endif //__SHAPE_H__